<?php

namespace App\Http\Controllers\Wechat;

use App\Libraries\classs\Face;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Wechat\BaseController;
use App\Models\User\Faces as Faces;
class FaceController extends BaseController
{
     public function index(){
         $data =array('success'=>false);
         $data['face_list']=array();
         $my_faces = Faces::where('x_uid','=',$this->_uid)->where('type','=',1)->orderBy('id','desc')->first();
         if($my_faces){
             $face =Face::getInstance()->getUserMateFaceList($this->_uid);
             if($face){
                 $data['face'] =$face;
                 $data['success']=true;
             }
         }
       
   	     $data['face_list']=Face::getInstance()->getMateFaceList();

         $new_face=Face::getInstance()->getMateFace($this->_uid);
         if($new_face){
             if($new_face->from_face_id == 208){
                 $new_face = "";
             }
         }
         $data['new_face'] = $new_face;

         
         return view('wechat.face.index',array('data'=>$data));
     }
}
